<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%--
    		s:a			:a
    		s:div			:div
    		s:if			:조건문
    		s:elseif		:다중조건문
    		s:iterator:루프문
    
    
     --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	a{text-decoration: none; color: black}
	a:HOVER {color: red}
</style>
</head>
<body>
	<center>
		<h1>내용 보기</h1>
		<table border=2 width=500 bordercolor=#d5d5d5 cellpadding="0" cellspacing="0">
			<tr>
				<td rowspan="2" width=20%>ID</td>
				<td rowspan="2" width=30%>${vo.id }</td>
				<td width=20%>조회수</td>
				<td width=30%>${vo.readnum }</td>
			</tr>
			<tr>
				<td width=20%>작성일</td>
				<td width=30%><s:date name="vo.writeday" format="yyyy-MM-dd" />
				</td>
			</tr>
			<tr>
				<td width=20%>제목</td>
				<td colspan=3 align=left>${vo.subject }</td>
			</tr>
			<tr>
				<td colspan=4 align=left valign=top height=220>${vo.content }</td>
			</tr>
		</table>
		<table width=500 border=0>
			<tr>
				<td align=right>
					
					<s:a href="../board/bbupdate.do?no=%{vo.no}&jsptype=%{jsptype}&ono=%{ono}&page=%{page}" theme="ajax" targets="blogcontent">수정</s:a> &nbsp; 
					<s:a href="../board/bbdelete.do?no=%{vo.no}&jsptype=%{jsptype}&ono=%{ono}&page=%{page}" theme="ajax" targets="blogcontent">삭제</s:a>&nbsp;
					<s:a href="../board/boardselect.do?&jsptype=%{jsptype}&ono=%{ono}&page=%{page}" theme="ajax" targets="blogcontent">
						목록
					</s:a>
				</td>
		</table>
		
		<!-- 댓글 -->
		
		<table border="1" cellpadding="0" cellspacing="0">
			<tr>
				<td>
				<s:iterator value="nblist">
				<form action="../board/blogreply_update.do" method="post" id="modireplyfrm">
				<table border=0 width=500 bordercolor=#d5d5d5 cellpadding="1" cellspacing="0">
					<tr id="nreply${no}" style="display:">
						<td width="15%" align="center">${id }</td>
						<td width="5%" align="left">|</td>
						<td width="60%" align="left">${content }<td>
						<td align="right" width="20%" id="delopenreply${no}" style="display:">
							<s:if test="#session.login == id">
								<a href="javascript:modiopen('nreply${no}','mreply${no }')">수정</a>|
								<%-- <s:a href="bora/newbroad/reply_delete.do?rno=%{no}&no=%{vo.no}&page=%{page}" theme="ajax" targets="blogcontent">삭제</s:a> --%>
								<a href="javascript:deleteopen('delopenreply${no}','delcloreply${no}')">삭제</a>
							</s:if>
							<s:else>
								&nbsp;
							</s:else>
						<td>
						<td align="right" width="20%" id="delcloreply${no}" style="display:none">
							<s:a href="../board/blogreply_delete.do?rno=%{no}&no=%{vo.no}&page=%{page}&jsptype=%{jsptype}&ono=%{ono}" theme="ajax" targets="blogcontent">삭제</s:a>
							|
							<a href="javascript:deleteclose('delopenreply${no}','delcloreply${no}')">취소</a>
						<td>
					</tr>
					<tr id="mreply${no}" style="display:none">
						<td width="15%" align="center">
							${sessionScope.login }
						</td>
						<td width="5%" align="left">|</td>
						<td width="60%" align="left">
							<input type="text" name="content" value="${content }">
							<input type="hidden" name="rno" value="${no }">
							<input type="hidden" name="no" value="${vo.no }">
							<input type="hidden" name="page" value="${page }">
							<input type="hidden" name="ono" value="${ono }">
							<input type="hidden" name="jsptype" value="${jsptype}">
							
						<td>
						<td width="20%" align="right">
							<s:a id="modireplyfrm" theme="ajax" targets="blogcontent" showLoadingText="false">
							수정
							</s:a>|
							<a href="javascript:modiclo('nreply${no}','mreply${no }')">취소</a>
						</td>
					</tr>
				</table>
				</form>	
				</s:iterator>					
				</td>
			</tr>
		</table>
		
		<form action="../board/blogreply_insert.do" method="post" id="newreplyfrm" name="nrfrm">
		<table border=0 width=500 bordercolor=#d5d5d5 cellpadding="1" cellspacing="0">
			<tr>
				<td width="20%" align="center">
					${sessionScope.login }
					<input type="hidden" name="id" value="${sessionScope.login }">
					<input type="hidden" name="no" value="${vo.no }">
					<input type="hidden" name="page" value="${page }">
					<input type="hidden" name="ono" value="${ono }">
					<input type="hidden" name="jsptype" value="${jsptype}">
				</td>
				<td width="60%" align="left">
					<input type="text" name="content" size="45">
				</td>
				<td width="20%">
					<s:if test="#session.login != null">
					<s:a id="newreplyfrm" theme="ajax" targets="blogcontent" showLoadingText="false">
						댓글달기
					</s:a>
					</s:if>
					<s:if test="#session.login == null">
					<a href="javascript:alert('로그인을 해주세요')">
						댓글달기
					</a>
					</s:if>
				</td>
			</tr>
		</table>
		</form>
		
	</center>
</body>
</html>